<%@ Page Language="C#" MasterPageFile="~/masterpages/admin.master" AutoEventWireup="true" CodeFile="CreditCardList.aspx.cs" Inherits="admin_CreditCardList" Title="CreditCard List Page" %>
<%@ Register Src="~/controls/EmptyGridMessage.ascx" TagPrefix="ucc" TagName="EmptyGridMessage" %>

<asp:Content ID="head" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content" ContentPlaceHolderID="Content" Runat="Server">
	<div class="row filterBox">
		<div class="col">
			<div class="row">
				<div class="col genericFilterText">Card title</div>
				<div class="col genericFilterSeperator">:</div>
				<div class="col genericFilterInput"><asp:TextBox ID="tbxCardTitle" runat="server" SkinID="GenericFilterTextBox"></asp:TextBox></div>
			</div>
			<div class="row">
				<div class="col genericFilterText">Card type</div>
				<div class="col genericFilterSeperator">:</div>
				<div class="col genericFilterInput"><asp:TextBox ID="tbxCardType" runat="server" SkinID="GenericFilterTextBox"></asp:TextBox></div>
			</div>
		</div>
        <div class="col">
			<div class="row">
				<div class="col genericFilterText">Card number</div>
				<div class="col genericFilterSeperator">:</div>
				<div class="col genericFilterInput"><asp:TextBox ID="tbxCardNumber" runat="server" SkinID="GenericFilterTextBox"></asp:TextBox></div>
			</div>
			<div class="row">
				<div class="col genericFilterText">Card code</div>
				<div class="col genericFilterSeperator">:</div>
				<div class="col genericFilterInput"><asp:TextBox ID="tbxCardCode" runat="server" SkinID="GenericFilterTextBox"></asp:TextBox></div>
			</div>
			<div class="row">
                <div class="col genericFilterText">&nbsp;</div>
                <div class="col genericFilterSeperator">&nbsp;</div>
                <div class="col genericFilterInput filterButton"><asp:Button ID="btnFilter" runat="server" Text="Search" OnClick="Filter_Click" SkinID="genericButton" /></div>
            </div>
        </div>
	</div>  
    <div class="row">
    <asp:GridView ID="grvCreditCardList" runat="server" AllowPaging="true" AllowSorting="true" 
        AutoGenerateColumns="false" DataKeyNames="Id" PageSize="4" OnRowCommand="grvCreditCardList_RowCommand" 
        OnRowDataBound="grvCreditCardList_RowDataBound" SkinID="GenericAdminList" OnSorting="grvCreditCardList_Sorting" >  
        <Columns>
            <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="id" />
			<asp:BoundField DataField="CardTitle" HeaderText="Card title" SortExpression="card_title" />
			<asp:BoundField DataField="CardNumber" HeaderText="Card number" SortExpression="card_number" />
			<asp:BoundField DataField="CardType" HeaderText="Card type" SortExpression="card_type" />
			<asp:BoundField DataField="CardCode" HeaderText="Card code" SortExpression="card_code" />
			<asp:CheckBoxField DataField="IsDefaultCard" HeaderText="Default card" ItemStyle-HorizontalAlign="Center" SortExpression="is_default_card" />
			<asp:BoundField DataField="CardHolderUserProfileId" HeaderText="Card holder user profile id" SortExpression="card_holder_user_profile_id" />
            <asp:TemplateField>
                <ItemStyle HorizontalAlign="Center" />
                <HeaderTemplate>
                    Edit
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:ImageButton ID="editButton" AlternateText="edit"
                        runat="server" CommandName="editCommand" />
                </ItemTemplate>               
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemStyle HorizontalAlign="Center" />
                <HeaderTemplate>
                    Delete
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:ImageButton ID="deleteButton" AlternateText="delete"
                        runat="server" CommandName="deleteCommand" />
                </ItemTemplate>               
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemStyle HorizontalAlign="Center" />
                <HeaderTemplate>
                    <asp:CheckBox runat="server" ID="selectAll" />
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox runat="server" ID="rowSelect" />
                </ItemTemplate>                
            </asp:TemplateField>
        </Columns>
        <EmptyDataTemplate>
            <ucc:EmptyGridMessage ID="emptyGridMessage" runat="server" />
        </EmptyDataTemplate>
    </asp:GridView>
    <div class="row genericGridFooter">
        <div class="col smallFont genericGridPageInfo" >
			<asp:Label ID="pagerLabel" runat="server" ></asp:Label>
		</div>
            <div class="col smallFont genericGridPager" >
				<asp:Repeater ID="pager" runat="server" OnItemCommand="Pager_Command" OnItemDataBound="Pager_DataBound">
                    <HeaderTemplate>
                        <asp:ImageButton ID="btnFirst" ImageAlign="AbsMiddle" AlternateText="First" runat="server" CommandName="first" />
                        <asp:ImageButton ID="btnPrev" ImageAlign="AbsMiddle" AlternateText="Prev" runat="server" CommandName="prev" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtMid" runat="server" Text='<%#  Convert.ToInt32(Container.DataItem) +1 %>' 
                            CommandName="paging" CommandArgument='<%#  Container.DataItem %>' />
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:ImageButton ID="btnNext" ImageAlign="AbsMiddle" AlternateText="Next" runat="server" CommandName="next"  />
                        <asp:ImageButton ID="btnLast" ImageAlign="AbsMiddle" AlternateText="Last" runat="server" CommandName="last" />
                    </FooterTemplate>
                </asp:Repeater>
			</div>
        </div>
        <div class="row genericGridButtons">
			<asp:Button ID="btnAddNew" runat="server" Text="Add Another" OnClick="AddNew_Click" SkinID="genericButton" />
			<asp:Button ID="btnDeleteSelected" runat="server" Text="Delete Selected Items" OnClick="Delete_Selected" SkinID="genericButton" />
		</div>
    </div>
</asp:Content>

